//创建“外壳”组件App
import React,{Component} from 'react'
import Search from './components/Search'
import List from './components/List'

//创建并暴露App组件
export default class App extends Component{
	state = {
		users: [], // 储存用户信息
		isFirst: true, // 是否是第一次打开页面
		isLoading: false, // 是否loading
		err: '', // 存储请求相关的错误信息
	}
	
	updateAppState = stateObj => {
		this.setState(stateObj)
	}
	render(){
		return (
			<div className="container">
				<Search updateAppState = {this.updateAppState}></Search>
				<List {...this.state}></List>
			</div>
		)
	}
}
